package com.zuqiuzhandui.liveing.view;

import android.os.Bundle;
import android.text.TextUtils;

import com.qiniu.android.dns.local.AndroidDnsServer;
import com.zuqiuzhandui.R;
import com.zuqiuzhandui.liveing.base.BaseActivity;
import com.zuqiuzhandui.liveing.common.UserInfomationManage;
import com.zuqiuzhandui.liveing.view.choose.ChooseActivity;
import com.zuqiuzhandui.liveing.view.login.LoginActivity;
import com.zuqiuzhandui.liveing.view.main.MainActivity;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

public class LodingPageActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setViewId() {
        setContentView(R.layout.activity_loding_page);
        Observable.timer(1500, TimeUnit.MILLISECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<Long>() {
                    @Override
                    public void call(Long aLong) {
                        goNextView();
                    }
                });
    }
    private void goNextView() {

        String accessKey = UserInfomationManage.getAccessKey();
        if (TextUtils.isEmpty(accessKey)) {
            toLastView(MainActivity.class);
            finish();
        } else
            toLastView(ChooseActivity.class);
            finish();

    }


}
